#pragma warning disable 108
using System;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using Cephei;
using Cephei.Core;
using Cephei.Core.Generic;
using Microsoft.FSharp.Core;
using Cephei.QL;
using Cephei.QL.Termstructures;
using Cephei.QL.Times;
namespace Cephei.QL.Instruments
{
    /// <summary> 
	/// ! \note This instrument currently assumes that the issuer did not default until today's date.  \warning if <tt>Settings::includeReferenceDateCashFlows()</tt> is set to <tt>true</tt>, payments occurring at the settlement date of the swap might be included in the NPV and therefore affect the fair-spread calculation. This might not be what you want.  \ingroup instruments
	/// </summary>
    [Guid ("FD192348-5CC5-4acc-9B0C-27BDDF862029"),ComVisible(true)]
	public interface ICreditDefaultSwap : Cephei.QL.IInstrument
	{
		///////////////////////////////////////////////////////////////
        // Methods
        //
        /// <summary> 
		/// 
		/// </summary>
		 Double CouponLegBPS {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Double CouponLegNPV {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Cephei.Core.IVector<Cephei.QL.ICashFlow> Coupons {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Double DefaultLegNPV {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Double FairSpread {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Double ImpliedHazardRate(Double targetNPV, Cephei.QL.Termstructures.IYieldTermStructure discountCurve, Cephei.QL.Times.IDayCounter dayCounter, Microsoft.FSharp.Core.FSharpOption<Double> recoveryRate, Microsoft.FSharp.Core.FSharpOption<Double> accuracy);
        /// <summary> 
		/// 
		/// </summary>
		 Double ConventionalSpread(Double conventionalRecovery, Cephei.QL.Termstructures.IYieldTermStructure discountCurve, Cephei.QL.Times.IDayCounter dayCounter);
        /// <summary> 
		/// 
		/// </summary>
		 Boolean IsExpired {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Double Notional {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Boolean PaysAtDefaultTime {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Boolean SettlesAccrual {get;}
        /// <summary> 
		/// 
		/// </summary>
		 QL.Protection.SideEnum Side {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Double FairUpfront {get;}
        /// <summary> 
		/// 
		/// </summary>
		 DateTime ProtectionEndDate {get;}
        /// <summary> 
		/// 
		/// </summary>
		 DateTime ProtectionStartDate {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Double RunningSpread {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Microsoft.FSharp.Core.FSharpOption<Double> Upfront {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Double UpfrontBPS {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Double UpfrontNPV {get;}
    }   

    /// <summary> 
	/// ! \note This instrument currently assumes that the issuer did not default until today's date.  \warning if <tt>Settings::includeReferenceDateCashFlows()</tt> is set to <tt>true</tt>, payments occurring at the settlement date of the swap might be included in the NPV and therefore affect the fair-spread calculation. This might not be what you want.  \ingroup instruments Factory
	/// </summary>
   	[ComVisible(true)]
    public interface ICreditDefaultSwap_Factory 
    {
        ///////////////////////////////////////////////////////////////
        // Factory methods
        //
        /// <summary> 
		/// 
		/// </summary>
	    ICreditDefaultSwap Create (QL.Protection.SideEnum side, Double notional, Double upfront, Double spread, Cephei.QL.Times.ISchedule schedule, QL.Times.BusinessDayConventionEnum paymentConvention, Cephei.QL.Times.IDayCounter dayCounter, Microsoft.FSharp.Core.FSharpOption<Boolean> settlesAccrual, Microsoft.FSharp.Core.FSharpOption<Boolean> paysAtDefaultTime, Microsoft.FSharp.Core.FSharpOption<DateTime> protectionStart, Microsoft.FSharp.Core.FSharpOption<DateTime> upfrontDate, Microsoft.FSharp.Core.FSharpOption<Cephei.QL.Instruments.IClaim> claim, Cephei.QL.IPricingEngine QL_Pricer);
        /// <summary> 
		/// 
		/// </summary>
	    ICreditDefaultSwap Create (QL.Protection.SideEnum side, Double notional, Double spread, Cephei.QL.Times.ISchedule schedule, QL.Times.BusinessDayConventionEnum paymentConvention, Cephei.QL.Times.IDayCounter dayCounter, Microsoft.FSharp.Core.FSharpOption<Boolean> settlesAccrual, Microsoft.FSharp.Core.FSharpOption<Boolean> paysAtDefaultTime, Microsoft.FSharp.Core.FSharpOption<DateTime> protectionStart, Microsoft.FSharp.Core.FSharpOption<Cephei.QL.Instruments.IClaim> claim, Cephei.QL.IPricingEngine QL_Pricer);
    }
}

